﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"    
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/xps/2005/06/resourcedictionary-key">
  
    <xsl:output method="xml" indent="yes"/>
    <xsl:include href="../include/locale.xslt"/>
    <xsl:include href="../include/styles.xslt"/>
    <xsl:include href="../include/deliveryHelpers.xslt"/>

  
    <xsl:template match="/ReportData">
      <FlowDocument        
        PageWidth="21cm"
        PageHeight="29.7cm"      
        PagePadding="60,40,40,40"      
        ColumnWidth="21 cm">
        
        <xsl:call-template name="styles"/>


        <xsl:call-template name="reportHeader">
          <xsl:with-param name="title" select="$_PROJECT_SCHEDULE"/>
        </xsl:call-template>


        <Paragraph Style="{{StaticResource GroupParagraph}}">
          <xsl:value-of select="$_DELIVERED_ITEMS"/>          
        </Paragraph>
        <Table>
          <TableRowGroup>
            <xsl:for-each select="Project/Sprints/Sprint[SprintNumber &lt; /ReportData/ProjectCurrentSprintNumber]">
              <xsl:sort select="SprintNumber" data-type="number"/>
              <TableRow>
                <TableCell>
                  <Paragraph FontWeight="Bold">
                    Sprint <xsl:value-of select="SprintNumber"/> - <xsl:value-of select="$_Items_delivered_at"/>
                    <xsl:call-template name="formatDate">
                      <xsl:with-param name="dateTime" select="StartDate" />
                    </xsl:call-template>
                  </Paragraph>
                  <xsl:call-template name="sprintDeliveries">
                    <xsl:with-param name="sprintNumber" select="SprintNumber"/>
                  </xsl:call-template>
                </TableCell>
              </TableRow>
            </xsl:for-each>
          </TableRowGroup>
        </Table>



        <Paragraph Style="{{StaticResource GroupParagraph}}">
        SCHEDULED ITEMS
        </Paragraph>
        <Table>
          <TableRowGroup>
            <xsl:for-each select="Project/Sprints/Sprint[SprintNumber &gt;= /ReportData/ProjectCurrentSprintNumber]">
              <xsl:sort select="SprintNumber" data-type="number"/>
              <TableRow>
                <TableCell>
                  <Paragraph FontWeight="Bold">
                    Sprint <xsl:value-of select="SprintNumber"/> - <xsl:value-of select="$_Items_planned_to_start_at"/>
                    <xsl:call-template name="formatDate">
                      <xsl:with-param name="dateTime" select="StartDate" />
                    </xsl:call-template>                                      
                  </Paragraph>
                  <xsl:call-template name="sprintDeliveries">
                    <xsl:with-param name="sprintNumber" select="SprintNumber"/>
                  </xsl:call-template>
                </TableCell>
              </TableRow>
            </xsl:for-each>            
          </TableRowGroup>  
        </Table>

        
        
        
      </FlowDocument>
    </xsl:template>
  


</xsl:stylesheet>
